﻿using System;

namespace Smith.AMC.Logging
{
    /// <summary>
    /// Interface for a logger that the memcached client will use to log messages to.
    /// Users of the memcached client can configure the memcached client to use their own implementation of a log.
    /// The reason to create this log interface is not not tie the memcached client to a specific 3rd party logger interface.
    /// </summary>
    public interface ILogger
    {
        /// <summary>
        /// Logs a warning to the log
        /// if the logger is configured for that log level
        /// </summary>
        /// <param name="logStatement">A Func that will return a string that should be logged</param>
        void Warn(Func<string> logStatement);

        /// <summary>
        /// Logs a debug statement to the log
        /// if the logger is configured for that log level
        /// </summary>
        /// <param name="logStatement">A Func that will return a string that should be logged</param>
        void Debug(Func<string> logStatement);

        /// <summary>
        /// Logs an error to the log
        /// if the logger is configured for that log level
        /// </summary>
        /// <param name="logStatement">A Func that will return a string that should be logged</param>
        void Error(Func<string> logStatement);

        /// <summary>
        /// Logs an exception to the log
        /// if the logger is configured for that log level
        /// </summary>
        /// <param name="logStatement">A Func that will return a string that should be logged</param>
        void Exception(Func<string> logStatement);

        /// <summary>
        /// Logs a info statement to the log
        /// if the logger is configured for that log level
        /// </summary>
        /// <param name="logStatement">A Func that will return a string that should be logged</param>
        void Info(Func<string> logStatement);
    }
}
